﻿
@model Easy.CMS.List.ViewModel.ListTops_Common_ViewModel
@using Easy.Web.CMS.Data;
@{
    Script.Reqiured("List").AtHead();
}

<style>
    .listrank{
        font-size:13px;
    }
    .listrank tbody tr td{
         padding:4px;
         vertical-align:middle;
    }
    .panel-body{
        padding:6px;
        padding-left:0;
    }
</style>
@{
    string height = @Model.Widget.Height.IsNullOrEmpty() ? "286px" : @Model.Widget.Height + "px";
}
<div id="listrank" style="height:@height;overflow-y:scroll;" class="listrank">
    @if (!Model.JsonResult.IsNullOrEmpty() && Model.Columns != null && Model.Columns.Count > 0)
    {
        var data = Json.Decode(Model.JsonResult);
        <table style="margin:0 auto; text-align:center;" class="table table-bordered table-hover">
            <tbody>
                <tr>
                    <td>
                        @Model.Columns[0]
                    </td>
                    <td>
                        @Model.Columns[1]
                    </td>
                </tr>
                @foreach (var item in data)
                {
                    var unit = !Model.Columns[0].IsNullOrEmpty() ? @item[Model.Columns[0]] : string.Empty;
                    var quantity = !Model.Columns[1].IsNullOrEmpty() ? @item[Model.Columns[1]] : string.Empty;
                    <tr>
                        <td>
                            @unit
                        </td>
                        <td>
                            @quantity
                        </td>
                    </tr>
                }
            </tbody>
        </table>

        <div style="margin:0 auto; text-align:center;">
            详细排名
        </div>
    }
</div>